package route

import (
	"gin-blog/app/controller"
	"github.com/gin-gonic/gin"
)

func Map(r *gin.Engine) {
	r.GET("/login", controller.Login)
	r.GET("/logout", controller.Logout)

	article := r.Group("/article")
	article.POST("/add", controller.AddArticle)
	article.POST("/upd", controller.UpdArticle)
	article.POST("/del", controller.DelArticle)
	article.POST("/edit", controller.EditArticle)

	r.GET("/ping", func(c *gin.Context) {
		c.JSON(200, gin.H{
			"message": "pong",
		})
	})
}
